package ma.platform.server.student.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import ma.platform.server.core.util.R;
import ma.platform.server.student.dto.SchoolStaticesDto;
import ma.platform.server.student.req.QueryStudentComboReq;
import ma.platform.server.student.req.QueryStudentComboTagReq;
import ma.platform.server.student.service.TbStudentComboService;
import ma.platform.server.student.vo.*;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("/studentCombo")
public class StudentComboController {

    @Resource
    private TbStudentComboService studentComboService;


    @GetMapping("/page")
    public R pageStudentCombo(@ParameterObject Page page, @ParameterObject QueryStudentComboReq req) {
        return R.ok(studentComboService.pageStudentCombo(page, req));
    }

    @GetMapping("/schoolStatices")
    public R<Page<SchoolStaticesDto>> schoolStatices(@ParameterObject Page page,@ParameterObject QueryStudentComboReq req){
        return R.ok(studentComboService.schoolStatices(page,req));
    }



    @GetMapping("/schoolDishStatices")
    public R<Page<SchoolStaticesDto>> schoolDishStatices(@ParameterObject Page page,@ParameterObject QueryStudentComboReq req){
        return R.ok(studentComboService.schoolDishStatices(page,req));
    }

    @GetMapping("/gradeStatices")
    public R<Page<SchoolStaticesDto>> gradeStatices(@ParameterObject Page page,@ParameterObject QueryStudentComboReq req){
        return R.ok(studentComboService.gradeStatices(page,req));
    }

    @GetMapping("/gradeDishStatices")
    public R<Page<SchoolStaticesDto>> gradeDishStatices(@ParameterObject Page page,@ParameterObject QueryStudentComboReq req){
        return R.ok(studentComboService.gradeDishStatices(page,req));
    }

    @GetMapping("/classesStatices")
    public R<Page<SchoolStaticesDto>> classesStatices(@ParameterObject Page page,@ParameterObject QueryStudentComboReq req){
        return R.ok(studentComboService.classesStatices(page,req));
    }

    @GetMapping("/classesDishStatices")
    public R<Page<SchoolStaticesDto>> classesDishStatices(@ParameterObject Page page,@ParameterObject QueryStudentComboReq req){
        return R.ok(studentComboService.classesDishStatices(page,req));
    }


    @GetMapping("/schoolStaticesExport")
    @ResponseExcel
    public List<SchoolExportVo> schoolStaticesExport(@ParameterObject QueryStudentComboReq req){
        return studentComboService.schoolStaticesExport(req);
    }

    @GetMapping("/schoolDishStaticesExport")
    @ResponseExcel
    public List<SchoolDishExportVo> schoolDishStaticesExport(@ParameterObject QueryStudentComboReq req){
        return studentComboService.schoolDishStaticesExport(req);
    }

    @GetMapping("/gradeStaticesExport")
    @ResponseExcel
    public List<GradeExportVo> gradeStaticesExport(@ParameterObject QueryStudentComboReq req){
        return studentComboService.gradeStaticesExport(req);
    }
    @GetMapping("/gradeDishStaticesExport")
    @ResponseExcel
    public List<GradeDishExportVo> gradeDishStaticesExport(@ParameterObject QueryStudentComboReq req){
        return studentComboService.gradeDishStaticesExport(req);
    }
    @GetMapping("/classesStaticesExport")
    @ResponseExcel
    public List<ClassesExportVo> classesStaticesExport(@ParameterObject QueryStudentComboReq req){
        return studentComboService.classesStaticesExport(req);
    }

    @GetMapping("/classesDishStaticesExport")
    @ResponseExcel
    public List<ClassesDishExportVo> classesDishStaticesExport(@ParameterObject QueryStudentComboReq req){
        return studentComboService.classesDishStaticesExport(req);
    }

    @GetMapping("/dowloadTag")
    public void dowLoadTag(HttpServletResponse response, @ParameterObject QueryStudentComboTagReq req){
        studentComboService.dowloadTag(response,req);
    }


    @GetMapping("/dowClassTable")
    public void dowClassTable(HttpServletResponse response, @ParameterObject QueryStudentComboReq req){
        studentComboService.dowloadClassTable(response,req);
    }
}
